import Vue from 'vue'
import App from './App'
import TuniaoUI from 'tuniao-ui'
Vue.use(TuniaoUI)
// #ifdef APP-PLUS || H5
import uView from "tuniao-ui/uview-ui";
Vue.use(uView);
// #endif
// 引入vuex
import store from './static/index.js'
// 把vuex定义成全局组件
Vue.prototype.$store = store

//接口和网络
import API from './utils/api.js'
import Net from './utils/net.js'
Vue.prototype.$API = API
Vue.prototype.$Net = Net
import i18n from './locale'

// 引入夜间模式工具
import { checkDarkMode, setDarkNavigationBar } from './utils/darkMode.js'

// 添加全局夜间模式检测
Vue.prototype.isDark = checkDarkMode()
Vue.prototype.checkDarkMode = checkDarkMode
Vue.prototype.setDarkNavigationBar = setDarkNavigationBar

// import cuCustom from './colorui/components/cu-custom.vue'
// Vue.component('cu-custom',cuCustom)
//页面类型
import find from './pages/tabPage/find.vue'
Vue.component('find',find)
import home from './pages/tabPage/home.vue'
Vue.component('home',home)
import msg from './pages/tabPage/msg.vue'
Vue.component('msg',msg)
import user from './pages/tabPage/user.vue'
Vue.component('user',user)
import allSection from './pages/tabPage/allSection.vue'
Vue.component('allSection',allSection)
//下面是列表和模块组件
import forumIndex from './pages/components/forumIndex.vue'
Vue.component('forumIndex',forumIndex)

import metas from './pages/components/metas.vue'
Vue.component('metas',metas)

import articleItemA from './pages/components/articleItemA.vue'
Vue.component('articleItemA',articleItemA)

import articleItemB from './pages/components/articleItemB.vue'
Vue.component('articleItemB',articleItemB)



import commentItem from './pages/components/commentItem.vue'
Vue.component('commentItem',commentItem)

import postCommentItem from './pages/components/postCommentItem.vue'
Vue.component('postCommentItem',postCommentItem)

import spaceItem from './pages/components/spaceItem.vue'
Vue.component('spaceItem',spaceItem)

import forumItem from './pages/components/forumItem.vue'
Vue.component('forumItem',forumItem)

import shopItem from './pages/components/shopItem.vue'
Vue.component('shopItem',shopItem)

import Share from './pages/components/Share.vue'
Vue.component('Share',Share)

import avatarItem from './pages/components/avatarItem.vue'
Vue.component('avatarItem',avatarItem)
// #ifdef APP-PLUS || H5
import articleItemWfA from './pages/components/articleItemWfA.vue'
Vue.component('articleItemWfA',articleItemWfA)

import articleItemWfB from './pages/components/articleItemWfB.vue'
Vue.component('articleItemWfB',articleItemWfB)

import appItemGrid from './pages/components/appItemGrid.vue'
Vue.component('appItemGrid',appItemGrid)

import appItemHorizontal from './pages/components/appItemHorizontal.vue'
Vue.component('appItemHorizontal',appItemHorizontal)
// #endif
import articleCardHorizontal from './pages/components/articleCardHorizontal.vue'
Vue.component('articleCardHorizontal',articleCardHorizontal)

import postCardHorizontal from './pages/components/postCardHorizontal.vue'
Vue.component('postCardHorizontal',postCardHorizontal)

import forumCardItem from './pages/components/forumCardItem.vue'
Vue.component('forumCardItem',forumCardItem)

import shopCardHorizontal from './pages/components/shopCardHorizontal.vue'
Vue.component('shopCardHorizontal',shopCardHorizontal)

import shopCardList from './pages/components/shopCardList.vue'
Vue.component('shopCardList',shopCardList)


// #ifdef APP-PLUS
import { addPermisionInterceptor } from '@/uni_modules/x-perm-apply-instr/js_sdk/index.js'
addPermisionInterceptor('chooseImage', '为了修改个人头像和发布信息图片视频等, 我们需要申请您设备的相机和存储权限')
addPermisionInterceptor('chooseVideo', '为了发布信息图片视频等, 我们需要申请您设备的相机和存储权限')
addPermisionInterceptor('saveImageToPhotosAlbum', '为了保存推广海报到手机相册, 我们需要申请您设备的存储权限')
addPermisionInterceptor('getLocation', '为了根据您的位置展示信息, 我们需要申请您设备的位置权限')
addPermisionInterceptor('makePhoneCall', '为了联系客服/用户/咨询等, 我们需要申请您设备的拨打电话权限')
addPermisionInterceptor('getRecorderManager', '为了使用语言消息功能等, 我们需要申请您设备的麦克风权限')
addPermisionInterceptor('startLocationUpdate', '为了根据您的位置展示信息, 我们需要申请您设备的位置权限')
addPermisionInterceptor('scanCode', '为了识别二维码信息, 我们需要申请您设备的相机权限')
// #endif
Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
	i18n,
	store,
    ...App
})
app.$mount()

 



